class CreateStudentEnrollments < ActiveRecord::Migration
  def self.up
    create_table :student_enrollments do |t|
      t.references :student
      t.references :group
      t.references :grade
      t.references :enrollment_type

      t.timestamps
    end
    add_index(:student_enrollments, [:student_id, :group_id], :unique => true)
  end

  def self.down
    remove_index(:student_enrollments, :column => [:student_id, :group_id])
    drop_table :student_enrollments
  end
end
